<%--
  Created by IntelliJ IDEA.
  User: KangFaWei
  Date: 2019/6/29
  Time: 9:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<ul>
    <c:forEach items="${requestScope.pageInfo.list}" var="answer">
        <li>
            <div class="us">
                <img src="<%=path%>/static/images/${answer.userinfo.headPic}"alt="">
                <span>${answer.userinfo.nickname}</span>
                <span><fmt:formatDate value="${answer.inputTime}" pattern="yyyy-MM-dd HH-mm"/> </span>
                <c:if test="${answer.accepted }"><span class="accepted">(已采纳)</span></c:if>
            </div>
            <div class="content">
                    ${answer.content}
                <div class="accept-answer">
                    <c:if test="${(not requestScope.finished) and (requestScope.userinfoId eq sessionScope.userinfo.id)}">
                        <a class="accept" data-id="${answer.id}" href="javascript:void(0);">采纳</a>
                    </c:if>
                </div>
                <%--<div class="handle">--%>
                        <%--&lt;%&ndash;<a href="#" class="active">赞</a>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;<span>${requestScope.praiseCount}</span>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;<a href="#" >否</a>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;<span>2323</span>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;<c:if test="${answer.accepted }">已采纳</c:if>&ndash;%&gt;--%>
                <%--</div>--%>
            </div>
        </li>
    </c:forEach>
        <div class="pagination">
            <span>共${requestScope.pageInfo.pageNum}页</span>
            <c:forEach items="${requestScope.pageInfo.navigatepageNums}" var="num">
                <c:if test="${requestScope.pageInfo.pageNum eq num}" var="cur">
                    <a style="color: #ee5f5b;" class="show-page" href="javascript:void(0);">${num}</a>
                </c:if>
                <c:if test="${not cur}">
                    <a class="show-page" href="javascript:void(0);">${num}</a>
                </c:if>
            </c:forEach>
        </div>
</ul>


